package cn.elead.chaos.framework.web.global;

import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;

import cn.hutool.core.date.DatePattern;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * 成功返回
 *
 * @author luopeng
 */
@Setter
@Getter
@ToString
@Builder
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
public class FailedResponse<T> extends ApiResponse<T> {

	private static final long serialVersionUID = 1L;
	/**
	 * http 状态码
	 */
	@Builder.Default
	private int code = 500;
	/**
	 * 错误描述
	 */
	private String msg;
	/**
	 * 异常信息
	 */
	private String exception;
	/**
	 * 当前时间戳
	 */
	@JsonFormat(timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN)
	private LocalDateTime time;
}
